import { createApp } from 'vue';
import BackRedoModel from "./BackRedoModel";
import store from "@/store";
import router from "@/router";

const showBackRedoModel = (data) => {
  // 创建应用实例
  const app = createApp(BackRedoModel);
  
  // 安装全局插件
  app.use(store);
  app.use(router);
  
  // 创建DOM容器并挂载应用
  const container = document.createElement('div');
  document.body.appendChild(container);
  
  // 挂载应用并获取组件实例
  const instance = app.mount(container);
  
  // 调用实例方法并返回结果
  return instance.showModal(data);
};

export default showBackRedoModel;